package com.example.controller;
import com.example.DTO.WellDataRequest;
import com.example.entity.WellProduct;
import com.example.service.WellProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;

/**
 * 生产井(WellProduct)表控制层
 *
 * @author makejava
 * @since 2025-09-17 19:41:31
 */
@RestController
public class WellProductController {
    @Autowired
    WellProductService service;
    // 获取所有井号
    @GetMapping("/list")
    public List<String> getWellList() {
        return service.getWellList();
    }
    // 批量查询：多个井号 + 时间范围
    @PostMapping("/data")
    public Map<String, List<WellProduct>> getWellData(@RequestBody WellDataRequest request) {
        return service.getWellData(request.getJhs(), request.getStartDate(), request.getEndDate());
    }

}

